Back to Contents Previous Next
13. Saving files from memory
We have already seen how data can be saved using ‘save windows’ but there are also occasions when you may wish to save a loaded file directly to a hard or floppy disc etc.
Each of the separate file-loading wimp-functions introduced in Section 2.12 has its file-saving counterpart. They are:
PROCwimp_savesprites()
- for sprite-files
PROCwimp_savedfile()
- for drawfiles
PROCwimp_savejpeg()
- for JPEG files
PROCwimp_savefile()
- for any other types of file
and they all work in a similar way. Taking the drawfile case as an example, the call is:
PROCwimp_savedfile(savepath$,dfile%)
where savepath$
is the full destination file and dfile%
is the handle of the drawfile already in memory.
In the case of the first three (file-specific) functions the correct file-typing is taken care of automatically, but in the fourth case (non-file-specific) there is an extra parameter for specifying the required file-type.
This non-file-specific case also needs a little care because of the separate storing of the file-size - as already mentioned at the end of the previous Section.
Top of page Back to Contents Previous Next